﻿--1 - Выбрать контакты человека

select C.[ContactType], C.[ContactValue]
	from [MyFamily].[dbo].[Persons] as P, [MyFamily].[dbo].[Contact] as C
	where (P.[ID] = C.[fk_PersonID] and P.[LastName] = 'Grinko' and P.[Name]='Nastya')

select [ContactType], [ContactValue] from [MyFamily].[dbo].[Contact]
where [fk_PersonID] in 
(select [ID]
 from  [MyFamily].[dbo].[Persons] where ([LastName] = 'Grinko' and [Name]='Nastya'))

select [ContactType], [ContactValue] from [MyFamily].[dbo].[Contact]
join 
  [MyFamily].[dbo].[Persons]
    on [MyFamily].[dbo].[Persons].[ID] = [MyFamily].[dbo].[Contact].[fk_PersonID]
	where ([LastName] = 'Grinko' and [Name]='Nastya')